package com.demo.service;

import com.demo.common.model.Buyrecord;
import com.demo.common.model.Flightrecord;
import com.demo.dao.BuyrecordDao;
import com.demo.dao.FlightrecordDao;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;

import java.util.List;

public class FlightrecordService {

    @Inject
    FlightrecordDao dao;

    public Page<Flightrecord> paginate(int pageNumber, int pageSize) {
        return dao.paginate(pageNumber, pageSize);
    }

    public Page<Flightrecord> paginate(int pageNumber, int pageSize, Kv cond) {
        return dao.paginate(pageNumber, pageSize, cond);
    }

    public Flightrecord findById(int id) {
        return dao.findById(id);
    }

    public void deleteById(int id) {
        dao.deleteById(id);
    }

    public List<Flightrecord> findAll() {
        return dao.findAll();
    }

    public int findDistancesByUserId(int userid){
        return dao.findDistancesByUserId(userid);
    }
}
